package com.yuyou.train.lesson.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.train.lesson.service.IResourceExamItemService;
import com.yuyou.train.lesson.service.IResourceExamService;
import com.yuyou.train.service.api.lesson.entity.ResourceExam;
import com.yuyou.train.service.api.lesson.entity.ResourceExamItem;
import com.yuyou.train.service.api.lesson.service.ExamAPI;





@RestController
public class ExamAPIImpl implements  ExamAPI{

	@Autowired
	private IResourceExamService resourceExamService;
	
	@Autowired
	private IResourceExamItemService resourceExamItemService;

	@Override
	public ResourceExam selectExamById(@RequestParam("id")String id) {
		return resourceExamService.selectByPrimaryKey(id);
	}

	@Override
	public ResourceExamItem selectExamItem(
			@RequestParam("resourceExamId") String resourceExamId,
			@RequestParam("resourceQuestionId") String resourceQuestionId,
			@RequestParam("sort") Integer sort) {
		return resourceExamItemService.selectExamItem(resourceExamId, resourceQuestionId, sort);
	}

	@Override
	public List<ResourceExamItem> findItemByExamId(@RequestParam("resourceExamId") String resourceExamId) {
		return resourceExamItemService.findExamItemByExamId(resourceExamId);
	}

	@Override
	public ResourceExamItem selectExamItemById(@RequestParam("id") String id) {
		return resourceExamItemService.selectByPrimaryKey(id);
	}
	


	

	
	
}
